﻿using Calligraphy.CalligraphyData;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Calligraphy.DataModel
{
    public class RubbingPhotoesDataSource
    {
        T_Rubbing _rubbing;

        public void LoadRubbingPhotoes(T_Rubbing rubbing)
        {
            _rubbing = rubbing;
            var q = from rp in DataServiceContextHelper.DataContext.T_RubbingPhoto.Expand("T_Rubbing").Expand("T_Photo") where rp.RubbingID == rubbing.ID && (rp.IsDeleted == null || rp.IsDeleted == false) orderby rp.PageNumber ascending select rp;
            rubbing.T_RubbingPhoto.LoadAsync(q);
        }
    }
}
